#include <iostream>
#include <cstdio>
using namespace std;
bool suShu(int a)
{
    for (int i = 2; i < a; i++)
    {
        if (a % i == 0)
        {
            return false;
        }
    }
    return true;
}
int main()
{
    int L, sum = 0, ZhongLiang = 0;
    cin >> L;
    for (int i = 2; i <= L; i++)
    {
        /*
        if (i == 2)
        {
            cout << i << endl;;
            ZhongLiang += i;
            if (ZhongLiang <= L)
            {
                sum++;
            }
            i++;
            continue;
        }
        */
        if (suShu(i))
        {
            ZhongLiang += i;
            if (ZhongLiang <= L)
            {
                cout << i << endl;
                sum++;
            }
            else
            {
                break;
            }
        }
    }
    cout << sum;
}